﻿using System;
using System.Collections.Generic;

namespace AdaptiveAgents.Distributions
{
    /// <summary>
    /// Represents a distribution and its data
    /// </summary>
    public interface IDistribution
    {
        /// <summary>
        /// Gets the mean of the distribution
        /// </summary>
        double Mean { get; }

        /// <summary>
        /// Gets the variance of the distribution
        /// </summary>
        double Variance { get; }

        /// <summary>
        /// Generates random distribution values according to distribution type 
        /// </summary>
        void generateRandomValues();

        /// <summary>
        /// Gets a description of the distribution
        /// </summary>
        /// <returns>String representation of the distribution</returns>
        String ToString();

        /// <summary>
        /// Gets f(x) (probability density function)
        /// </summary>
        /// <param name="x">Random variable</param>
        /// <returns>f(x) according to the distribution function</returns>
        double valueOf(double x);

        /// <summary>
        /// Gets F(x) (probability cumulative density function)
        /// </summary>
        /// <param name="x">Random variable</param>
        /// <returns>F(x) according to the distribution function</returns>
        double cumulativeValueOf(double x);

        /// <summary>
        /// Gets a sample of the distribution values
        /// </summary>
        /// <returns>Array of points that were sampled from the distribution function</returns>
        Point[] sample();

        /// <summary>
        /// Gets the distribution type
        /// </summary>
        DistributionType Type { get; }

        /// <summary>
        /// Generates random value
        /// </summary>
        /// <returns>Random value according to distribution type</returns>
        double generateValue();
    }
}
